﻿using UnityEngine;
using System.Collections;

namespace UI
{
    public class UILuckTwoHeroTemplate : UILuckHeroTemplate
    {
        public UITexture hero0;
        public UITexture hero1;
        
        public UISprite heroFrame0;
        public UISprite heroFrame1;

        public GameObject mask0;
        public GameObject mask1;

        public GameObject active0;
        public GameObject active1;

        public override void SetIcon()
        {
            MainTexture(hero0, heros[0].heroData.iconName);
            MainTexture(hero1, heros[1].heroData.iconName);
            heroFrame0.spriteName = GetFrameRes(heros[0].heroData.quality);
            heroFrame1.spriteName = GetFrameRes(heros[1].heroData.quality);
        }

        protected override void Actived(bool yes0, bool yes1 = false, bool yes2 = false)
        {
            active0.SetActive(yes0);
            active1.SetActive(yes1);
        }

        protected override void Masked(bool yes0, bool yes1 = false, bool yes2 = false)
        {
            mask0.SetActive(yes0);
            mask1.SetActive(yes1);
        }

        public override void OnClick()
        {
            UILuck.ShowLuckPopupBox(luck.luckData.id);
        }
    }
}